package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.annotation.UserParam;
import cn.wolfcode.wolf2w.domain.UserInfo;
import cn.wolfcode.wolf2w.redis.IVisitorRedisService;
import cn.wolfcode.wolf2w.redis.vo.VisitorVo;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("visitors")
public class VisitorController {

    @Autowired
    private IVisitorRedisService visitorRedisService;

    @GetMapping("/vo")
    public Object vo(String id, @UserParam UserInfo userInfo){
       VisitorVo vo = visitorRedisService.queryNumByuid(id,userInfo.getId());
        return JsonResult.success(vo);
    }
}
